package onlinecalsys.client.view.gui;

import java.awt.FlowLayout;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

/*
 * LabelDemo.java needs one other file:
 *   images/middle.gif
 */
public class AboutInfo extends JPanel {
	
	/**
	 * 
	 */

	public AboutInfo() {
		super(new FlowLayout()); // 3 rows, 1 column
		JLabel label1;

		ImageIcon icon = createImageIcon("images/help.gif",
				"a pretty but meaningless splat");

		// Create the first label.
		label1 = new JLabel("", icon, JLabel.CENTER);
		// Set the position of its text, relative to its icon:



		// Add the labels.
		add(label1);
	}

	/** Returns an ImageIcon, or null if the path was invalid. */
	protected ImageIcon createImageIcon(String path, String description) {
		java.net.URL imgURL = AboutInfo.class.getResource(path);
		if (imgURL != null) {
			return new ImageIcon(imgURL, description);
		} else {
			System.err.println("Couldn't find file: " + path);
			return null;
		}
	}

	/**
	 * Create the GUI and show it. For thread safety, this method should be
	 * invoked from the event dispatch thread.
	 */
	private void createAndShowGUI() {
		// Create and set up the window.
		JFrame frame = new JFrame("About");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		//load frame logo
		
		
		// Add content to the window.
		frame.add(new AboutInfo());
		// frame.setSize(100, 100);

		// Display the window.
		frame.pack();
		frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frame.setVisible(true);
		frame.setResizable(false);
	}

	public void main(String[] args) {
		// Schedule a job for the event dispatch thread:
		// creating and showing this application's GUI.
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				createAndShowGUI();
			}
		});
	}
}
